package com.sushi.utils;

import com.sushi.response.ResponseBO;

/**
 * @author wywei
 */
public class ResponseUtil {


    public static <T> ResponseBO<T> ok(T object) {
        ResponseBO<T> resp = new ResponseBO<>();
        resp.setData(object);
        resp.setCode(200);
        return resp;
    }

    public static <T> ResponseBO<T> ok() {
        return ok(null);
    }

    public static <T> ResponseBO<T> error(String msg) {
        ResponseBO<T> resp = new ResponseBO<>();
        resp.setMsg(msg);
        resp.setCode(999);
        return resp;
    }


}
